﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace freecart.Controls
{
    public partial class ViewCart : System.Web.UI.UserControl
    {
        public decimal TotalUnitPrice;
        public decimal GetUnitPrice(decimal Price, int Quantity)
        {
            TotalUnitPrice += (Quantity * Price);
            return (Quantity * Price);
        }
        public decimal GetTotal()
        {
            return TotalUnitPrice;
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Context.Session["SessionId"] != null)
            {
                DataTable dt = (new Freecart()).RetrieveCart((Guid)Context.Session["SessionId"]);
                GridView1.DataSource = dt;
                GridView1.DataBind();
            }
        }
    }
}